﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using HR60_PanelSoft.View.Base;

namespace HR60_PanelSoft.View.TabForms
{
	public partial class NewDeviceForm : BaseForm
	{
		public NewDeviceForm()
		{
			InitializeComponent();
		}

		// 绑定数据
		public void refreshFormData()
		{
			// 类型分组列表
			selGroup.bindData(deviceTypeGroups);

			// 类型列表
			if (deviceTypeGroups.Length == 0)
			{
				selType.cleanItems();
				return;
			}
			selType.bindData(deviceTypes[deviceTypeGroups[0]], "name");

			//selGroup.ValueChanged += new EventHandler(selGroup_ValueChanged);
            selGroup.ValueChanged += new ValueChangedHandler(selGroup_ValueChanged);
		}

		void selGroup_ValueChanged(object sender, EventArgs e)
		{
			selType.bindData(deviceTypes[selGroup.Value.ToString()], "name");
		}

	}
}
